home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / addflo / data1.cab / Program_Executable_Files / AddFlow / Samples / Demo / Flowchar.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-05-06  |  8.0 KB  |  260 lines

  1. VERSION 4.00
  2. Begin VB.Form frmFlowchar 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    Caption         =   "Example 4: FlowChart"
  6.    ClientHeight    =   3990
  7.    ClientLeft      =   1050
  8.    ClientTop       =   1680
  9.    ClientWidth     =   5790
  10.    DrawStyle       =   5  'Transparent
  11.    BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  12.       Name            =   "MS Sans Serif"
  13.       Size            =   8.25
  14.       Charset         =   0
  15.       Weight          =   700
  16.       Underline       =   0   'False
  17.       Italic          =   0   'False
  18.       Strikethrough   =   0   'False
  19.    EndProperty
  20.    ForeColor       =   &H000000C0&
  21.    Height          =   4395
  22.    Left            =   990
  23.    LinkTopic       =   "Form4"
  24.    MDIChild        =   -1  'True
  25.    ScaleHeight     =   3990
  26.    ScaleWidth      =   5790
  27.    Tag             =   "4"
  28.    Top             =   1335
  29.    Width           =   5910
  30.    Begin VB.PictureBox Picture1 
  31.       Appearance      =   0  'Flat
  32.       AutoSize        =   -1  'True
  33.       BackColor       =   &H80000005&
  34.       ForeColor       =   &H80000008&
  35.       Height          =   930
  36.       Index           =   3
  37.       Left            =   4770
  38.       Picture         =   "Flowchar.frx":0000
  39.       ScaleHeight     =   900
  40.       ScaleWidth      =   900
  41.       TabIndex        =   3
  42.       Top             =   2940
  43.       Visible         =   0   'False
  44.       Width           =   930
  45.    End
  46.    Begin VB.PictureBox Picture1 
  47.       Appearance      =   0  'Flat
  48.       AutoSize        =   -1  'True
  49.       BackColor       =   &H80000005&
  50.       ForeColor       =   &H80000008&
  51.       Height          =   930
  52.       Index           =   2
  53.       Left            =   4770
  54.       Picture         =   "Flowchar.frx":0802
  55.       ScaleHeight     =   900
  56.       ScaleWidth      =   900
  57.       TabIndex        =   2
  58.       Top             =   1980
  59.       Visible         =   0   'False
  60.       Width           =   930
  61.    End
  62.    Begin VB.PictureBox Picture1 
  63.       Appearance      =   0  'Flat
  64.       AutoSize        =   -1  'True
  65.       BackColor       =   &H80000005&
  66.       ForeColor       =   &H80000008&
  67.       Height          =   930
  68.       Index           =   1
  69.       Left            =   4770
  70.       Picture         =   "Flowchar.frx":1004
  71.       ScaleHeight     =   900
  72.       ScaleWidth      =   900
  73.       TabIndex        =   1
  74.       Top             =   1020
  75.       Visible         =   0   'False
  76.       Width           =   930
  77.    End
  78.    Begin VB.PictureBox Picture1 
  79.       Appearance      =   0  'Flat
  80.       AutoSize        =   -1  'True
  81.       BackColor       =   &H80000005&
  82.       ForeColor       =   &H80000008&
  83.       Height          =   930
  84.       Index           =   0
  85.       Left            =   4770
  86.       Picture         =   "Flowchar.frx":1806
  87.       ScaleHeight     =   900
  88.       ScaleWidth      =   900
  89.       TabIndex        =   0
  90.       Top             =   60
  91.       Visible         =   0   'False
  92.       Width           =   930
  93.    End
  94.    Begin AddFlowLib.AddFlow AddFlow1 
  95.       Height          =   3495
  96.       Left            =   270
  97.       TabIndex        =   4
  98.       Top             =   240
  99.       Width           =   3825
  100.       _Version        =   65536
  101.       _ExtentX        =   6747
  102.       _ExtentY        =   6165
  103.       _StockProps     =   101
  104.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  105.          Name            =   "Arial"
  106.          Size            =   8.25
  107.          Charset         =   0
  108.          Weight          =   400
  109.          Underline       =   0   'False
  110.          Italic          =   0   'False
  111.          Strikethrough   =   0   'False
  112.       EndProperty
  113.       BorderStyle     =   1
  114.       ScrollBars      =   3
  115.       Shape           =   0
  116.       LinkStyle       =   0
  117.       Alignment       =   7
  118.       AutoSize        =   0
  119.       ArrowDst        =   3
  120.       ArrowOrg        =   0
  121.       DrawStyle       =   0
  122.       DrawWidth       =   1,4013e-45
  123.       ReadOnly        =   0   'False
  124.       MultiSel        =   -1  'True
  125.       CanDrawNode     =   -1  'True
  126.       CanDrawLink     =   -1  'True
  127.       CanMoveNode     =   -1  'True
  128.       CanSizeNode     =   -1  'True
  129.       CanStretchLink  =   -1  'True
  130.       CanMultiLink    =   -1  'True
  131.       Transparent     =   0   'False
  132.       ShowGrid        =   0   'False
  133.       Hidden          =   0   'False
  134.       Rigid           =   0   'False
  135.       DisplayHandles  =   -1  'True
  136.       AutoScroll      =   -1  'True
  137.       xGrid           =   7,00649e-45
  138.       yGrid           =   7,00649e-45
  139.       xZoom           =   100
  140.       yZoom           =   100
  141.       FillColor       =   16777215
  142.       DrawColor       =   0
  143.       ForeColor       =   0
  144.       BackPicture     =   "Flowchar.frx":2008
  145.    End
  146. Attribute VB_Name = "frmFlowchar"
  147. Attribute VB_Creatable = False
  148. Attribute VB_Exposed = False
  149. Option Explicit
  150. Sub CursorShape(AddFlow1 As Control)
  151.   With AddFlow1
  152.     Dim area%
  153.     area = .PointedArea
  154.     Select Case area
  155.     Case 0
  156.       .MousePointer = 8
  157.     Case 1
  158.       .MousePointer = 7
  159.     Case 2
  160.       .MousePointer = 6
  161.     Case 3
  162.       .MousePointer = 9
  163.     Case 7
  164.       If .SelectMode = True Then
  165.         .MousePointer = 2
  166.       Else
  167.         .MousePointer = 0
  168.       End If
  169.     End Select
  170.   End With
  171. End Sub
  172. Private Sub AddFlow1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  173.   Me.SetFocus
  174. End Sub
  175. Private Sub Form_Activate()
  176.   frmMain.ActivateForm
  177. End Sub
  178. Private Sub Form_Deactivate()
  179.   frmMain.DeactivateForm
  180. End Sub
  181. Private Sub Form_Load()
  182.   frmMain.ShowExample(3).Enabled = False
  183.   Dim nodx As afNode, lnkx As afLink
  184.   Dim pt As New afLinkPoint
  185.   With AddFlow1
  186.     .Left = 0
  187.     .Top = 0
  188.     ' Just to accelerate display (Don't forget to reset it at the end)
  189.     .Repaint = False
  190.     ' Default settings
  191.     .AutoSize = afAdjustNodeSizetoPicture
  192.     .Shape = afRectangle
  193.     .LinkStyle = afBezier
  194.     ' Create nodxs
  195.     Set nodx = .Nodes.Add(200, 200, 800, 800)
  196.     nodx.Shape = afRoundRect
  197.     nodx.Text = "BEGIN"
  198.     Set nodx.Picture = Picture1(1).Picture
  199.     Set nodx = .Nodes.Add(200, 2200, 800, 800)
  200.     nodx.Text = "STEP1"
  201.     Set nodx.Picture = Picture1(0).Picture
  202.     Set nodx = .Nodes.Add(2200, 2200, 800, 800)
  203.     nodx.Shape = afDiamond
  204.     nodx.Text = "Success?"
  205.     Set nodx.Picture = Picture1(2).Picture
  206.     Set nodx = .Nodes.Add(4200, 1000, 800, 800)
  207.     nodx.Text = "STEP3"
  208.     Set nodx.Picture = Picture1(0).Picture
  209.     Set nodx = .Nodes.Add(6200, 2200, 800, 800)
  210.     nodx.Shape = afRoundRect
  211.     nodx.Text = "END"
  212.     Set nodx.Picture = Picture1(1).Picture
  213.     Set nodx = .Nodes.Add(4200, 3400, 800, 800)
  214.     nodx.Shape = afEllipse
  215.     nodx.Text = "STEP2"
  216.     Set nodx.Picture = Picture1(3).Picture
  217.     .DrawStyle = 0
  218.     .ArrowDst = afEmptyArrow30
  219.     .ForeColor = RGB(0, 0, 255)
  220.     .DrawColor = RGB(0, 0, 255)
  221.     ' Create lnkxs
  222.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(2))
  223.     Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(3))
  224.     Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(4))
  225.     pt.X = 2440
  226.     pt.Y = 1840
  227.     lnkx.ExtraPoints.Add pt
  228.     pt.X = 2840
  229.     pt.Y = 1440
  230.     lnkx.ExtraPoints.Add pt
  231.     lnkx.Text = "YES"
  232.     Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(6))
  233.     pt.X = 2640
  234.     pt.Y = 3840
  235.     lnkx.ExtraPoints.Add pt
  236.     lnkx.Text = "NO"
  237.     Set lnkx = .Nodes(4).OutLinks.Add(.Nodes(5))
  238.     Set lnkx = .Nodes(6).OutLinks.Add(.Nodes(5))
  239.     .Repaint = True
  240.   End With
  241. End Sub
  242. Private Sub Form_Resize()
  243.   If WindowState <> 1 And ScaleHeight <> 0 Then
  244.     AddFlow1.Height = ScaleHeight
  245.     AddFlow1.Width = ScaleWidth
  246.   End If
  247. End Sub
  248. Private Sub Form_Unload(Cancel As Integer)
  249.   frmMain.ShowExample(3).Enabled = True
  250. End Sub
  251. Private Sub AddFlow1_KeyDown(KeyCode As Integer, Shift As Integer)
  252.   Const KEY_DELETE = &H2E
  253.   If KeyCode = KEY_DELETE Then
  254.     AddFlow1.DeleteSel
  255.   End If
  256. End Sub
  257. Private Sub AddFlow1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  258.   CursorShape AddFlow1
  259. End Sub
  260.